import sys
import types
from jyutils.log import debug
# , info, warn, error, critical, log

import jyutils.log as log
module =sys.modules[__name__]
print(debug)
debug('debug')
print(debug)
sys.exit(0)
# import sys
# print(sys.executable)
# def test():
#     # pass
#     f=_find_caller(1)
#     return f

# f=_find_caller(1)
# module =sys.modules[f.f_globals['__name__']]
# print(isinstance(module, types.ModuleType))
# # for attr in dir(module):
# #     print(attr,'=',getattr(module, attr))

def template(func):
    test = 1
    def wrapper(*args, **kwargs):
        print('before',func.__name__,globals()[func.__name__] is wrapper)
        result = func(*args, **kwargs)
        print('after',)
        return result
    return wrapper

@template
def add(a,b):
    return a+b
@template
def sub(a,b):
    return a-b
print(add)
# print(add(1,2))
add(1,2)
sub(1,2)